-- GENERATED SPELL FOR [Twilight Shadowmage] --


function spell0_4813(pUnit, Event) --@Dominate Mind,n/a--
pUnit:FullCastSpellOnTarget(7645,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4813', 12000, 1)
end

function spell1_4813(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4813', 3000, 1)
end

function spell2_4813(pUnit, Event) --@Summon Voidwalker,Self--
pUnit:FullCastSpellOnTarget(12746,pUnit)
pUnit:RegisterEvent('Sorts_4813', 586, 1)
end

function Sorts_4813(pUnit, Event)
local choix_sorts_4813 = math.random(0, 2)
if choix_sorts_4813 == 0 then
pUnit:RegisterEvent('spell0_4813', 1, 1)
end
if choix_sorts_4813 == 1 then
pUnit:RegisterEvent('spell1_4813', 1, 1)
end
if choix_sorts_4813 == 2 then
pUnit:RegisterEvent('spell2_4813', 1, 1)
end
end

function mob4813_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_4813', math.random(1500, 3000), 1)
end

function mob4813_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4813_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4813_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(4813, 1, 'mob4813_Action')
RegisterUnitEvent(4813, 2, 'mob4813_Leave')
RegisterUnitEvent(4813, 3, 'mob4813_Kill')
RegisterUnitEvent(4813, 4, 'mob4813_Die')
